package com.ct.application.order.listener;

import com.ct.application.order.listener.event.OrderEvent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class OrderEmailListener implements ApplicationListener<OrderEvent> {


    @Override
    @Async
    public void onApplicationEvent(OrderEvent event) {
        log.info("邮件发送成功，用户是：{}", event.getUserId());
    }
}
